home *** CD-ROM | disk | FTP | other *** search
/ Aminet 40 / Aminet 40 (2000)(Schatztruhe)[!][Dec 2000].iso / Aminet / comm / tcp / Amster-main.lha / Amster_Install / Rexx / SongPlayer.rexx < prev    next >
OS/2 REXX Batch file  |  2000-10-22  |  1KB  |  46 lines

  1. /*
  2. ** $VER: SongPlayer 1.1 (22.10.2000)
  3. ** © 2000 by Jacob Laursen <laursen@myself.com>
  4. **
  5. ** Set up your player path below and some of these events in Amster:
  6. **
  7. ** Download finished
  8. ** Double-clicking library file
  9. ** Double-clicking download file
  10. ** MP3 player
  11. **
  12. ** To play the file immediately:
  13. **   Command:  RexxC:RX Apps:Comm/Amster/Rexx/SongPlayer.rexx PLAY "%f"
  14. **
  15. ** To add the file to the playlist:
  16. **   Command:  RexxC:RX Apps:Comm/Amster/Rexx/SongPlayer.rexx ADD "%f"
  17. **
  18. ** To add the file to the playlist and play only if the player is stopped or paused:
  19. **   Command:  RexxC:RX Apps:Comm/Amster/Rexx/SongPlayer.rexx ADDPLAY "%f"
  20. */
  21.  
  22. PlayerPath = 'Apps:Sound/Players/SongPlayer/SongPlayer'
  23.  
  24. /* No user-serviceable parts below */
  25.  
  26. options results
  27. parse arg mode' 'filename
  28.  
  29. if ~show('P','SONGPLAYER.1') then address command PlayerPath' 'filename' GUI'
  30. else do
  31.   address 'SONGPLAYER.1'
  32.   if upper(mode) = 'PLAY' then do
  33.     'OPEN 'filename
  34.     PLAY
  35.   end
  36.   else if upper(mode) = 'ADD' | upper(mode) = 'ADDPLAY' then do
  37.     'ADD 'filename
  38.     if upper(mode) = 'ADDPLAY' then do
  39.       'GET_STATE'; state = RESULT
  40.       if state = 'STOP' | state = 'PAUSE' then do
  41.         'NEXT'; 'PLAY'
  42.       end
  43.     end
  44.   end
  45. end
  46.